import images from './imgs';
const state = {
  NavIdx: Number,
  NavTitle: "",
  NavIcon: "",
  NavUrl: "",
  NavShadow: "",
  DataCon: [],
  ObjCon: {
    data: [
      {
        id: 0,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781178.png",
        linkName: "",
        link: "zhxzzx",
        text: "超市便利"
      },
      {
        id: 1,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781135.png",
        linkName: "",
        link: "",
        text: "兼职"
      },
      {
        id: 2,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781178.png",
        linkName: "",
        link: "zhxzzx",
        text: "超市便利"
      },
      {
        id: 3,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781135.png",
        linkName: "",
        link: "",
        text: "兼职"
      },
      {
        id: 4,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781178.png",
        linkName: "",
        link: "zhxzzx",
        text: "超市便利"
      },
      {
        id: 5,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781135.png",
        linkName: "",
        link: "",
        text: "兼职"
      },
      {
        id: 6,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781178.png",
        linkName: "",
        link: "zhxzzx",
        text: "超市便利"
      },
      {
        id: 7,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781135.png",
        linkName: "",
        link: "",
        text: "兼职"
      },
      {
        id: 8,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781178.png",
        linkName: "",
        link: "zhxzzx",
        text: "超市便利"
      },
      {
        id: 9,
        img: "https://zltc-1255680458.cos.ap-beijing.myqcloud.com/1566781135.png",
        linkName: "",
        link: "",
        text: "兼职"
      }
    ],
    style: {
      textAlign: "",
      fontSize: "",
      backgroundColor: "",
      textDecoration: "",
      fontStyle: "",
      fontWeight: ""
    },
    navImg: {
      boxShadow: "0px 0px 0px rgba(51, 174, 138, 1)"
    }
  }
}

const mutations = {
  SetNav_Title: (state, text) => {
    state.NavTitle = text;
  },
  SetNav_Idx: (state, id) => {
    state.NavIdx = id;
  },
  SetNav_Img: (state) => {
    state.NavIcon = images.state.imgUrl;
  },
  SetNav_Url: (state, url) => {
    state.NavUrl = url;
  },
  SetNav_Data: (state, obj) => {
    state.DataCon = obj.data;
    state.ObjCon = obj;
  }
}
// 更新全部设置数据保存当前应用数据
const actions = {
  setNavAllData({ commit, dispatch }, obj) {
    commit('SetNav_Data', obj);
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
